<template>
	<view hover-class='none' class="user-cell-bar uni-bg-color uni-font-size-base" @click.stop="onClick">
		<icon-bar v-if="leftIcon" :name="leftIcon" class="user-cell-left"></icon-bar>
		<view class="user-cell-center">
			<view v-if="title">{{title}}</view>
			<slot name='title'></slot>
		</view>
		<icon-bar :name="rightIcon" :size='30' class="user-cell-right"></icon-bar>			
	</view>
</template>

<script>
	export default {
		name: 'uniCellBar',
		title: '单元格',
		props: {
			title: {
				type: String,
				default: ''
			},
			leftIcon: {
				type: String,
				default: ''
			},
			rightIcon: {
				type: String,
				default:'iconright'
			},
			url: {
				type: String,
				default: ''
			}
		},
		methods: {
			onClick() {
				if(this.url){
					uni.navigateTo({
					    url: this.url
					});
					return false
				}
				this.$emit('onClick')
			}
		},
		data() {
			return {
				
			};
		}
	}
</script>

<style lang="scss" scoped>
	.user-cell-bar{
		width: 100%;
		height: 100upx;
		padding: 0 30upx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		margin-bottom: 10upx;
		.user-cell-center{
			flex: 1;
			width: 100%;
			padding: 0 10upx;
			box-sizing: border-box;
		}
	}
</style>
